package com.chinacoal.hr.levelimpl.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.chinacoal.hr.levelapi.entity.AttendanceInfo;
import com.chinacoal.hr.levelapi.entity.AttendanceInfoTemp;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author: YunTao.Li
 * @create: 2019-11-13 17:20
 * @description: 考勤信息service
 **/
public interface AttendanceInfoService {
    public IPage<AttendanceInfo> getAttendanceInfoPage(Map<String, Object> condition) throws Throwable;

    public IPage<AttendanceInfo> getUnusualAttendanceInfoPage(Map<String, Object> condition);

    public List<AttendanceInfo> getAttendanceInfoList(String beginDate, String endDate) throws Throwable;

    /**
     * 同步考勤信息
     *
     * @param beginDateStr :
     * @param endDateStr   :
     * @return : java.util.Map<java.lang.String,java.lang.String>
     * @author : YunTao.Li
     * @date : 2019/12/22 2019/12/22
     */
    public Map<String, String> syncAttendanceInfo(String beginDateStr, String endDateStr) throws Throwable;

    /**
     * 并发同步
     *
     * @param beginDateStr :
     * @param endDateStr   :
     * @param factor       : 天数因子,几天一个线程
     * @return : java.util.Map<java.lang.String,java.lang.String>
     * @author : YunTao.Li
     * @date : 2020/1/7 2020/1/7
     */
    public Map<String, String> concurrentSyncAttendanceInfo(String beginDateStr, String endDateStr, int factor) throws Throwable;

    public Map<String, String> coverAttendanceInfo(String empCode, Date attendDate, AttendanceInfoTemp attendanceInfoTemp) throws Throwable;

    /**
     * 根据条件获得唯一的考勤记录(select one )
     *
     * @return : com.chinacoal.hr.levelimpl.entity.AttendanceInfo
     * @author : YunTao.Li
     * @date : 2020/7/24 2020/7/24
     */
    public AttendanceInfo getAttendanceInfo(String empCode, Date attendDate) throws Throwable;

    public Map<String, String> updateAttendanceInfo(AttendanceInfo attendanceInfo) throws Throwable;


    /**
     * 根据出差、请假、申诉记录来更新考勤明细数据
     *
     * @param empCode    : 员工code
     * @param attendDate : 日期
     * @param timeType   :
     * @param paType     :
     * @return : java.util.Map<java.lang.String,java.lang.String>
     * @author : YunTao.Li
     * @date : 2020/7/26 2020/7/26
     */
    public Map<String, String> attendanceInfoFixedByProcess(String empCode, Date attendDate, String timeType, String paType) throws Throwable;
}
